<?php
/**
 * Elgg bookmarks plugin everyone page
 *
 * @package Bookmarks
 */

$page_owner = elgg_get_page_owner_entity();
if (!$page_owner) {
	forward('golfscore/all');
}

elgg_push_breadcrumb($page_owner->name);

// elgg_register_title_button();

$content = '<div class="add-score">' . elgg_view('output/url', array(
		'href' => "golfscore/add",
		'text' => elgg_echo('golfscore:add'),
		'is_trusted' => true,
	)) . '</div>';

$friends = get_user_friends($page_owner->guid, "", 999999, 0);
$friendguids = array();
foreach ($friends as $friend) {
	$friendguids[] = $friend->getGUID();
}
$friendguids[] = $user_guid;
return elgg_list_golf_score(array('user_entity_ids' => $friendguids));
$content .= elgg_list_friends_golf_score();

$title = elgg_echo('golfscore:owner', array($page_owner->name));

$params = array(
		'content' =>  $content,
		'filter' => '',
		'sidebar' => '',		
		'nav' => '',
		'class' => 'elgg-river-layout',
);

$body = elgg_view_layout('one_sidebar', $params);

echo elgg_view_page($title, $body);